def easy_calculator():
    def output(num):
        numint = int(num)
        print(num) if num != numint else print(numint)
    s = input(">>>welcome to use this calculator\nplease input the first optional number:\n>>>").strip()
    while s not in ('logout','exit',''):
        num1 = float(s)
        sign = input(">>>please input the operator(only support: + - * /):\n>>>").strip()
        while sign not in ('+','-','*','/'):
            sign = input(">>>please input the right operator(only support: + - * /):\n>>>").strip()
        s2 = input('>>>please input the second optional number:\n>>>').strip()
        if sign == '/':
            while s2 == '0':
                s2 = input('>>>DIVISOR CANNOT BE ZERO;\n'
                             '>>>please input the second optional number:\n>>>').strip()
        num2 = float(s2)
        if sign == '+':
            output(num1+num2)
        elif sign == '-':
            output(num1 - num2)
        elif sign == "*":
            output(num1 * num2)
        else:
            output(round(num1/num2,4))
        s = input(">>>please input the first optional number\n(input exit or logput or JUST PESS ENTER can exit calcultaor):"
                  "\n>>>").strip()
    print('>>>Thank you for using')

easy_calculator()



